package com.miage.pki.form;

import java.io.IOException;
import java.io.InputStream;

import org.springframework.web.multipart.commons.CommonsMultipartFile;

public class UploadItem
{
  private CommonsMultipartFile fileData;
 
  public CommonsMultipartFile getFileData()
  {
    return fileData;
  }
 
  public void setFileData(CommonsMultipartFile fileData)
  {
    this.fileData = fileData;
  }
  
  public InputStream getInputStream(){
	  try {
		return fileData.getInputStream();
	} catch (IOException e) {
		// TODO Auto-generated catch block
		e.printStackTrace();
	}
	return null;
  }
  
  public boolean isComplete(){
	if(fileData == null || fileData.getName()==null){
		return false;
	}
	  
	return true;
  }
  
}